#set( $symbol_pound = '#' )
#set( $symbol_dollar = '$' )
#set( $symbol_escape = '\' )
package ${package}.${artifactId};

import com.alibaba.dubbo.rpc.RpcContext;
import ${package}.facade.DemoService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Value;

import static ${package}.facade.DemoService.PRODUCT_VERSION;

/**
 * Default {@link DemoService}
 *  https://nacos.io/zh-cn/docs/use-nacos-with-dubbo.html
 * @since 2.6.5
 */
//@DubboService(version = "${symbol_dollar}{demo.${artifactId}.version}")
@DubboService(version = PRODUCT_VERSION)
public class DefaultService implements DemoService {

    @Value("${symbol_dollar}{demo.${artifactId}.name}")
    private String ${artifactId}Name;

    public String sayName(String name) {
        RpcContext rpcContext = RpcContext.getContext();
        return String.format("Service [name :%s , port : %d] %s(${symbol_escape}"%s${symbol_escape}") : Hello,%s",
                ${artifactId}Name,
                rpcContext.getLocalPort(),
                rpcContext.getMethodName(),
                name,
                name);
    }
}